package com.leyou.item.mapper;

import com.leyou.item.pojo.Category;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.additional.idlist.SelectByIdListMapper;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @Author: taft
 * @Date: 2018-10-10 10:12
 */
public interface CategoryMapper extends Mapper<Category>,SelectByIdListMapper<Category,Long> {

    @Select("SELECT c.* FROM tb_category c LEFT JOIN tb_category_brand cb ON c.id = cb.category_id where cb.brand_id = #{bid}")
    List<Category> queryByBrandId(@Param("bid") Long bid);
}
